package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.SourceMapper;
import com.youlai.boot.system.model.QB.Source;
import com.youlai.boot.system.service.SourceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class SourceServiceImpl extends ServiceImpl<SourceMapper, Source> implements SourceService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private SourceMapper sourceMapper;
    @Override
    public boolean saveSource(Source source) {

        source.setAddtime(LocalDateTime.now());
        return save(source);
    }

    @Override
    public List<Source> getAllSource() {
        return sourceMapper.selectList(null);
    }

    @Override
    public boolean deleteSourceById(Integer id) {
        return sourceMapper.deleteById(id) > 0;
    }
}
